@extends('layouts.template')

@section('title', '个人中心')

@section('header')
@endsection

@section('content')
    <script src="{{asset('dist/refund/detail.js')}}"></script>
    <script>
        var refund_result_type = '{{$refund->refund_result_type}}';
        var arbitrate_result_type = '{{$refund->arbitrate_result_type}}';
    </script>
    <div class="ziliao" id="div" v-cloak>

        @if ($order->status->have_arbitrate)
            @if ($refund->arbitrating)
                <a href="{{url("refund/arbitrate/{$refund->id}")}}" class="tk05">下单用户向平台客服申请仲裁，客服调查取证中...</a>
            @elseif ($refund->arbitrate_agree)
                <a href="{{url("refund/arbitrate/{$refund->id}")}}" class="tk05">仲裁已经完成，客服判定支持{{$refund->arbitrate_result_type_text}}。</a>
            @elseif ($refund->arbitrate_disagree)
                <a href="{{url("refund/arbitrate/{$refund->id}")}}" class="tk05">仲裁已经完成，客服判定不支持退款。</a>
            @endif
        @endif

        <div v-if="!refund_result_type" class="ziliao_b " style="margin-bottom:10px;"><p>您还未处理退款申请，还剩余{{$refund->auto_refund_endtime}}，系统将默认自动退款给用户。</p>
        </div>

        <div class="tuikuan mar07">
            <div class="tk01">
                <div class="pj_ico01"><a href="{{url("order/refund/{$order->id}")}}"><img src="{{asset('images/ico13.png')}}" ></a></div>
                <h2>配送+安装</h2>
                <p>订单编号：{{$order->order_number}}</p>
            </div>

        </div>

        <div class="tk03">
            <h2>退款信息</h2>
            <p>申请时间：{{$refund->refund_time}}</p>
            <p>下单用户：{{$order->merchant->me_username}}</p>
            <p>联系电话：{{$order->merchant->me_phone}}</p>
            <p>退款类型：{{$refund->refund_type_text}}</p>
            <p>退款金额：<i class="col02">{{$refund->master_refund_amount}}元</i></p>
            <p>退款编号：{{$refund->id}}</p>
            <p>退款说明：{{$refund->refund_reason}}</p>
        </div>

        <section>
            <div v-if="refund_result_type == '{{$refund_result_agree}}'" class="tk03 overflow_h">
                <h2>我的操作</h2>
                <p>操作结果：<span class="col02">同意退款申请</span></p>
                <p>操作时间：{{$refund->refund_result_time}}</p>
            </div>
            <div v-else-if="refund_result_type == '{{$refund_result_disagree}}'" class="tk03 overflow_h">
                <h2>我的操作</h2>
                <p>操作结果：<span class="col02">不同意退款申请</span></p>
                <p>操作时间：{{$refund->refund_result_time}}</p>
                <p>拒绝说明：{{$refund->refund_refuse_reason}}</p>
            </div>
            <div v-else class="tk03 overflow_h">
                <form action="" method="post" id="form">
                    {{csrf_field()}}
                    <h2>退款操作</h2>
                    <b>对退款申请有疑问请直接和下单用户联系，沟通后再操作。</b>
                    <div class="overflow_h">
                        <label><span :class="{t_sp01:true,text03:agree==true}">
                        <input @click="agree = true" name="refund_result_type" value="{{$refund_result_agree}}" type="radio">同意退款申请</span></label>
                        <label><span :class="{t_sp01:true,text03:agree==false}">
                        <input @click="agree = false" name="refund_result_type" value="{{$refund_result_disagree}}" type="radio">不同意退款申请</span></label>
                    </div>
                    <div v-if="!agree" class="tk04">
                        <textarea class="inp04" name="refund_refuse_reason" cols="45" rows="5" placeholder="请填写拒绝退款原因，100字内。"></textarea>
                    </div>

                    <button class="but07 mar07" type="submit">确认提交</button>
                </form>
            </div>
        </section>

    </div>
@endsection